/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lenovo
 * Date: 2022-09-05
 * Time: 21:56
 */
public class Demo {
    public static void main(String[] args) {
        Thread thread = new Thread(()->{
            while(true){
                System.out.println("hello thread");
                try {
                    Thread.sleep(1_000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"这是俺的线程");
        thread.start();

        System.out.println(thread.getId());//12
        System.out.println(thread.getName());//这是俺的线程
        System.out.println(thread.getPriority());//5
        System.out.println(thread.isDaemon());//false
        System.out.println(thread.getState());//TIMED_WAITING
        System.out.println(thread.isAlive());//true
        System.out.println(thread.isInterrupted());//false
    }
}
